package com.zl.smartmall.library.po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class EquipmentImage implements Serializable {
	private String equiment_code;
	private String id;
	private String image_1;
	private String image_2;
	private String image_3;
	private String image_4;

	public String getEquiment_code() {
		return equiment_code;
	}

	public void setEquiment_code(String equiment_code) {
		this.equiment_code = equiment_code;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getImage_1() {
		return image_1;
	}

	public void setImage_1(String image_1) {
		this.image_1 = image_1;
	}

	public String getImage_2() {
		return image_2;
	}

	public void setImage_2(String image_2) {
		this.image_2 = image_2;
	}

	public String getImage_3() {
		return image_3;
	}

	public void setImage_3(String image_3) {
		this.image_3 = image_3;
	}

	public String getImage_4() {
		return image_4;
	}

	public void setImage_4(String image_4) {
		this.image_4 = image_4;
	}
	public static List<EquipmentImage> parse(JSONArray jsonArray) throws JSONException {
		List<EquipmentImage> mainInfolist = new ArrayList<EquipmentImage>();
		for(int j = 0; jsonArray != null && j < jsonArray.length();j++){
			EquipmentImage mainInfo = new EquipmentImage();
			JSONObject img = jsonArray.getJSONObject(j);
			mainInfo.setImage_1(img.getString("image_1"));
			mainInfo.setImage_2(img.getString("image_2"));
			mainInfo.setImage_3(img.getString("image_3"));
			mainInfo.setImage_4(img.getString("image_4"));
			mainInfolist.add(mainInfo);
		}
		return mainInfolist;
	}

	public static EquipmentImage parse(JSONObject jsonObject) throws JSONException {
			EquipmentImage mainInfo = new EquipmentImage();
			mainInfo.setImage_1(jsonObject.getString("image_1"));
			mainInfo.setImage_2(jsonObject.getString("image_2"));
			mainInfo.setImage_3(jsonObject.getString("image_3"));
			mainInfo.setImage_4(jsonObject.getString("image_4"));
		return mainInfo;
	}
}
